﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;

public class NavBar : MonoBehaviour {

	//---------------------------------------------------------------------------------------------
	// Members 

	public List<string> m_PanelNames;
	public Text m_Next;
	public Text m_Previous;
	public ScrollRectSnap m_PanelData;
	
	
	
	
	//---------------------------------------------------------------------------------------------
	// Properties
	
	int nextPanel;
	int prevPanel;
	int currentPanel;
	
	//---------------------------------------------------------------------------------------------
	// init
	
	void Start()
	{
		nextPanel = 2;
		prevPanel = 0;
	}
	
	//---------------------------------------------------------------------------------------------
	// Core Functions 
	
	void Update()
	{
	
		m_Next.text = m_PanelNames[nextPanel];
		m_Previous.text = m_PanelNames[prevPanel];
		
		if(m_PanelData.RealScreen > currentPanel)
		{
			nextPanel ++;
			prevPanel ++;
		}
		if(m_PanelData.RealScreen < currentPanel)
		{
			nextPanel --;
			prevPanel --;
		}
	
	}
	
	void LateUpdate()
	{
	
		currentPanel = m_PanelData.RealScreen;
		
	
	}
	
}
